package fr.azzale.casu.utils;

import android.os.AsyncTask;
import fr.azzale.casu.activity.TribuneActivity;
import fr.azzale.casu.metier.Tribune;

public class GetTribuneASync extends AsyncTask<Void, Void, Tribune> {

	private TribuneActivity callingActivity;
	private String cookie;

	public GetTribuneASync(TribuneActivity tribuneActivity, String cookie) {
		callingActivity = tribuneActivity;
		this.cookie = cookie;
	}

	@Override
	protected Tribune doInBackground(Void... params) {
		return Utils.getTribuneFromWeb(callingActivity, cookie);
	}

	@Override
	protected void onPostExecute(Tribune result) {
		callingActivity.displaySpinnner(false);
		callingActivity.displayResults(result);
	}

	@Override
	protected void onPreExecute() {
		callingActivity.displaySpinnner(true);
	}

	
}
